﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ImobitechModel.com.Constantes;
using ImobitechModel.com.Controller;

namespace Imobitech.Gestao
{
    public partial class Visita : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Logar login = (Logar)Session["loginAdmin"];
                if (login.papeis.Where(p => p.nome == "Corretor").FirstOrDefault() != null)
                {
                    ControladorGestao cg = new ControladorGestao();
                    int id = login.papeis.Where(p => p.nome == "Corretor").FirstOrDefault().id;
                    gdvVisita.DataSource = cg.retornaVisitas(id);
                    gdvVisita.DataBind();
                }
                    
            }
        }
    }
}